//
// Created by EmFi on 2023/5/12.
//

#ifndef DBMS_POINT_H
#define DBMS_POINT_H

#include "../define.h"

class Point {
private:
    bool null;
    bool empty_flag[4] = {false, false, false, false};
    int push_index = 0;
    double x, y, z, w;

    void setX(double x);
    void setY(double y);
    void setZ(double z);
    void setW(double w);
public:
    Point(bool null): null(null) {}
    Point(): null(false) {}

    int push(double num);

    double getX() const;
    double getY() const;
    double getZ() const;
    double getW() const;

    friend std::ostream &operator<<(std::ostream &os, const Point &point);

    bool operator==(const Point &rhs) const;

    bool operator!=(const Point &rhs) const;

    void fill();

    bool check();

    bool isNull() const {
        return this->null;
    }
};

static Point nullPoint(true);

#endif //DBMS_POINT_H
